function shallowClone(obj) {
    const newObj = {};
    for (const key in obj) {
        newObj[key] = obj[key];
    }
    return newObj;
};
const obj = {
    name: "echo",
    hobbies: ["abc", "cds"],
    friends: {
        address: "11"
    },
    foo: function () {
        console.log("qq");
    }
};
const newObj = shallowClone(obj);
obj.name = "er";
obj.friends.address = "ww";
console.log(newObj);